//
//  ADDetailViewController.m
//  NGApp
//
//  Created by huazi on 14-7-7.
//  Copyright (c) 2014年 Kevin. All rights reserved.
//

#import "ADDetailViewController.h"

@interface ADDetailViewController ()<UIWebViewDelegate>
{
    UIActivityIndicatorView *ActivityIndicatorView;
}
@end

@implementation ADDetailViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}
- (void)setData {
    self.title =self.titleStr;
}
- (void)viewDidLoad
{
    
    [super viewDidLoad];
    
//    UIView *view =[[UIView alloc] initWithFrame:CGRectMake(0, 0, DeviceWidth, 64)];
//    view.backgroundColor =[UIColor colorWithHexString:@"#f2f3f7"];
//    
//    self.labelTitleView =[[UILabel alloc] initWithFrame:CGRectMake(80, 20, 160, 44)];
//    self.labelTitleView.backgroundColor =[UIColor clearColor];
//    self.labelTitleView.font =[UIFont systemFontOfSize:17.0];
//    self.labelTitleView.textAlignment =NSTextAlignmentCenter;
//    self.labelTitleView.text =self.titleStr;
//    [view addSubview:self.labelTitleView];
//    
//    UIButton *btnleftView = [[UIButton alloc] initWithFrame:CGRectMake(0, 20, 44, 44)];
//    [btnleftView setImage:[UIImage imageNamed:@"navBack"] forState:UIControlStateNormal];
//    [btnleftView setContentMode:UIViewContentModeScaleAspectFit];
//    [btnleftView addTarget:self action:@selector(PopNav:) forControlEvents:UIControlEventTouchUpInside];
//    [view addSubview:btnleftView];
//    [self.view addSubview:view];
    
    self.view.backgroundColor =[UIColor whiteColor];
    self.webView =[[UIWebView alloc] initWithFrame:CGRectMake(0, 0, DeviceWidth, DeviceHeight-64)];
    self.webView.delegate =self;
//    NSString *str =@"http://121.41.33.76:8080/t98/apphtml/userAgree/userAgree.html";
//      NSString *str =@"http://www.baidu.com";
    [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:self.web_url]]];
    self.webView.scalesPageToFit =YES;
    ActivityIndicatorView =[[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
    ActivityIndicatorView.center =CGPointMake(DeviceWidth/2, DeviceHeight/2-44);
    [self.view addSubview:self.webView];
    [self.view addSubview:ActivityIndicatorView];
    [ActivityIndicatorView startAnimating];
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
- (void)webViewDidFinishLoad:(UIWebView *)webView
{
    [ActivityIndicatorView stopAnimating];
}
@end
